package com;

import com.mapper.WorkerMapper;
import com.pojo.Worker;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

public class Workertest {
    @Test
    public void findWorkerByIdTest(){
        SqlSession session = MyBatisUtils.getSession();
        WorkerMapper mapper =session.getMapper(WorkerMapper.class);
        Worker worker = mapper.selectWorker(1);
        System.out.println(worker.toString());
        session.close();
    }
    @Test
    public void intertWorkerTest(){
        SqlSession session = MyBatisUtils.getSession();
        Worker worker = new Worker();
        worker.setId(4);
        worker.setName();
        worker.setId(4);
        worker.setId(4);



        System.out println(worker.toString());
        session.commit();
        session.close();
    }
}
